<template>
  <div>
      <div class="taile">
        消息
      </div>
      <div class="nav">
        <input type="text" v-model="title" @input="fn()" placeholder="搜索">
      </div>
      <div class="box" v-show="open">
          <dldom v-for="(item,index) in data" :key="index" :item="item">
             
          </dldom>
      </div>
      <div class="open" v-show="!open">
          12
      </div>
  </div>
</template>

<script>
import dldom from "../components/dldom.vue"
export default {
  data(){
    return{
      data:[
        {
          title:"天泽",
          name:"作业学完了没 666"
        },{
          title:"余杭",
          name:"作业学完了没 666"
        },{
          title:"柏树",
          name:"作业学完了没 666"
        },{
          title:"余淮",
          name:"作业学完了没 666"
        },{
          title:"医药",
          name:"作业学完了没 666"
        }
      ],
      title:"",
      open:true,
      list:[]
    }
  },
  components:{
    dldom
  },
  methods:{
    fn(){
        if(this.title!=""){
          this.open=false
          
        }else{
          this.open=true
        }
    }
  }
}
</script>

<style>
  .taile{
    width: 100%;
    height: 40px;
    background: lightblue;
    text-align: center;
    line-height: 40px;
    color: #fff;
  }
  .nav{
    width: 100%;
    height: 30px;
    text-align: center;
    
  }
  .nav input{
    box-sizing: border-box;
    width: 90%;
    border: none;
    outline:none;
    background: #eee;
    border-radius: 20px;
    line-height: 30px;
    padding-left: 150px;
  }
  .item{
    border-bottom: 1px solid #eee;
  }
  .size{
    display: inline-block;
    background: #eee;
    width: 100px;
    height: 100px;;
  }
  dd,dt{
    display: inline-block;
  }
</style>
